<?php
class SecurityUtils
{
	public static function RandNumberToken($e){
		$randStr = "";
		for($i=0;$i<$e;$i++){
			$randStr = $randStr . mt_rand(0, 9); 
		}
		
 		return $randStr;
	} 
	
	public static function updateToken()
	{
		$_SESSION['tokenNumber'] = SecurityUtils::RandNumberToken(8);
				
		$tokenNumber = SecurityUtils::RandNumberToken(8);
		$_SESSION['loginToken'] = sha1($tokenNumber);
	}
	
	public static function check_cookie()
	{
		setcookie("arf", "arf", time() + 360);
		if(isset ($_COOKIE['arf']))
		{
			return true;
		}
		
		return false;
	}
}